home *** CD-ROM | disk | FTP | other *** search
- ;-------------------------decdoubl routine begins--------------------------+
- ; from BLUEBOOK OF ASSEMBLY ROUTINES FOR IBM PC & XT.
- ; page : 103
- ;
- ; NAME DECDOUBL
- ;
- ; ROUTINE FOR Doubling A Temporary Decimal Floating Point Number
- ;
- ; FUNCTION: This routine multiplies a temporary decimal floating point
- ; number by two.
- ;
- ; INPUT: Upon ebtry DS:DI points to a temporary decimal floating point
- ; number.
- ;
- ; OUTPUT: Upon exit the number has been doubled.
- ;
- ; REGISTERS USED: AX, CX and DI are modified.
- ;
- ; SEGMENTS REFERENCED: The data segment contains storage for the temporary
- ; decimal floating poiint number.
- ;
- ; ROUTINES CALLED: None
- ;
- ; SPECIAL NOTES: This is a near procedure called by FPOUT
- ;
- ; ROUTINE TO MULTIPLY TEMPORARY DECIMAL FLOATING POINT NUMBER BY 2 - RESULT
- ; NOT NORMALIZED.
- ;
- decdoubl proc near
- ;
- mov cx,25 ; for a count of 25
- mov ah,0 ; clear previous carry
- ;
- decdoubl1:
- mov al,[di] ; get digit
- sal al,1 ; multip0ly by 2
- and al,ah ; add the carry
- aam ; adjust for decimal multiplication
- mov [di],al ; put the byte back
- inc di ; point to next byte
- loop decdoubl1
- ;
- ret ; return
- ;
- decdoubl endp
- ;-------------------------decdoubl routine ends---------------------------+